<?php
class Property extends ActiveRecord\Model{

	static $belongs_to = array(

	array('category','class_name'=>'category'),
	array('customer','class_name'=>'customer'),
	array('contract','class_name'=>'contract'),
	array('transaction','class_name'=>'transaction'),
	array('aauth_user','class_name'=>'aauth_user')
	);

	static $has_many = array(
     array('photos','class_name'=>'photo')
     );
	public static function find_num_rows()
	{
		$array = self::first(array('select' => 'count(*) AS num_rows'))->attributes();

		return $array['num_rows'];
	}
}